home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / tools / qtools / include / libraries / quicktools.h
C/C++ Source or Header  |  1995-03-09  |  3KB  |  113 lines

  1. /*        QuickTools.h         */
  2.  
  3. #ifndef    QUICKTOOLS_H
  4. #define    QUICKTOOLS_H
  5.  
  6. #ifndef    EXEC_TYPES_H
  7. #include <exec/types.h>
  8. #endif   /* EXEC_TYPES_H */
  9.  
  10. #ifndef    EXEC_NODES_H
  11. #include <exec/nodes.h>
  12. #endif    /* EXEC_NODES_H */
  13.  
  14. #ifndef    EXEC_LISTS_H
  15. #include <exec/lists.h>
  16. #endif    /* EXEC_LISTS_H */
  17.  
  18. #ifndef    EXEC_SEMAPHORES_H
  19. #include    <exec/semaphores.h>
  20. #endif    /* EXEC_SEMAPHORES_H */
  21.  
  22. #ifndef    EXEC_TASKS_H
  23. #include    <exec/tasks.h>
  24. #endif    /* EXEC_TASKS_H */
  25.  
  26. #ifndef UTILITY_TAGITEM_H
  27. #include <utility/tagitem.h> 
  28. #endif    /* UTILITY_TAGITEM_H */
  29.  
  30. #define    QUICKTOOLSNAME            "quicktools.library"
  31. #define    QUICKTOOLSVERSION        2L
  32.  
  33. #define    REG(x)    register __ ## x
  34.  
  35. #ifdef QUICKTOOLS_PRIVATE    /* Private structures and definitions. */
  36.  
  37. #define FILEBUFFERSIZE        5120
  38.  
  39. struct QToolsData
  40. {
  41.     struct SignalSemaphore DataSem;
  42.     struct SignalSemaphore DirLoadSem;
  43.     APTR DirDataBuffer;
  44.     ULONG DirDataLength;
  45.     struct Qdata **DirData;
  46.     UWORD NumDirs;
  47. };
  48.  
  49. struct ParsePathPart
  50. {
  51.     struct ParsePathPart *pp_Next;
  52.     ULONG pp_Size;
  53.     BOOL  pp_Root;
  54.     UBYTE pp_ParsePattern[1];
  55. };
  56.  
  57. struct MatchData
  58. {
  59.     ULONG    md_ScanType;        /*  What kind of matchdata is this  */
  60.     BOOL md_Done;
  61.  
  62.     ULONG md_CurData;            /*  Common data for file and dir matching  */
  63.     struct ParsePathPart *md_Patterns;
  64.     char md_SearchBuf[32];
  65.  
  66.     struct Qdata *md_CurQdata;    /*  Data used only for file matching  */
  67.     BPTR md_FileHandle;
  68.     APTR md_FileBuffer;
  69.     ULONG md_NumFiles;
  70. };
  71.  
  72. #endif /* QUICKTOOLS_PRIVATE */    /* Public structures and definitions */
  73.  
  74. #define QUICKTOOLSDATAPATH    "s:"
  75. #define QUICKTOOLSDIRS         "QuickTools.Dirs"
  76. #define QUICKTOOLSFILES     "QuickTools.Files"
  77.  
  78. struct Qdata {
  79.     UWORD    qd_ParrID;
  80.     unsigned char qd_UsePrev;    /*  Nr of chars from previous to use    */
  81.     char qd_FileName[1];            /*  Packed name of this file                */
  82. };
  83.  
  84. /*  Scantypes defined for the QT_ScanType tag  */
  85.  
  86. #define QT_SCAN_FILE            1
  87. #define QT_SCAN_DIRECTORY    2
  88.  
  89. /*  Tags  */
  90.  
  91. #define    QT_TagBase                    TAG_USER
  92.  
  93. /*  Tags understood by SetupMatchData() and FindMatchReq()  */
  94.  
  95. /*  Type of items to scan for                                */
  96. #define QT_ScanType                    (QT_TagBase+1)
  97. /*  Don't add '#?' to the last part                        */
  98. #define QT_ExactLastPart            (QT_TagBase+2)
  99. /*  Don't add any '#?' to the given match                */
  100. #define QT_ExactMatch                (QT_TagBase+3)
  101.  
  102.  
  103. /*  Tags understood by FindMatchReq()  */
  104.  
  105. /*  Title to use for requesterwindow                    */
  106. #define QT_ReqTitle                    (QT_TagBase+100)
  107. /*  Center the requester on the screen                    */
  108. #define QT_CenterReq                    (QT_TagBase+101)
  109. /*  Screen to open requester on                            */
  110. #define QT_PubScreen                    (QT_TagBase+102)
  111.  
  112. #endif    /* QUICKTOOLS_H */
  113.